package com.quwan.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;

/**
 * @author quan
 * @date 2022-01-18 17:58
 */
@Getter
@AllArgsConstructor
public enum OrderScaleEnum {

    TRANS_MONEY(1, "提现抽成比例","0.02"),
    PUBLISH_ORDER(2, "发单抽成比例","0.3"),
    DISPATCH_ORDER_BEFORE(3, "派单预支付比例","0.2"),
    DISPATCH_ORDER_AFTER(4, "派单尾款抽成比例","0.3"),
    DISPATCH_ORDER_CANCEL(5, "派单取消费用","0.2"),
    PUBLISH_ORDER_CANCEL(6, "发单取消费用","0.2");


    Integer type;
    String name;
    String defScale;


    public static OrderScaleEnum getByType(Integer type) {
        for (OrderScaleEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }
}
